import datetime
from common.config.settings import Settings


def init_logger(settings: "Settings"):
    from loguru import logger
    logger.remove()  # 移除默认
    logger.add(f"{settings.log_path}/log_{datetime.datetime.now().date()}.log",
               rotation="00:00",
               compression="zip",
               level=settings.log_level)
    return logger
